<div class="title ui-corner-all"> 
Add a new project
</div>

<div class="ui-corner-all">
<? if (isset($this->viewParams['result']) && $this->viewParams['result']['success']) :?>

	<? if ($this->viewParams['mode'] == "new") :?>
		<div class="success">New project with id #<?= $this->viewParams['result']['insertedId']?> has been added successfully</div>
	<? else :?>
		<div class="success">Project with id #<?= $this->viewParams['id']?> has been updated successfully</div>
	<?endif?>

	<? if (isset($this->viewParams['result']['errorMessage'])) :?>
	<div class="error"><?= $this->viewParams['result']['errorMessage']?></div>
	<?endif?>
<?endif?>
</div>

<form enctype="multipart/form-data" method="POST">
<? $form = $this->viewParams['form'];?>
<br/>
	Category : <?= $form->category?>
	<br/>
	Vn Name : <?=$form->name_vi ?>
	<br/>
	En Name : <?=$form->name_en ?>
	
	<br/>
	Vietnamese Description: (<a href="javascript:void()" class="color-switcher"> Set background color</a>)
	<br/>
	<?=$form->description_vi ?>
	<br/>
	English Description: (<a href="javascript:void()" class="color-switcher"> Set background color</a>)
	<br/>
	<?=$form->description_en ?>
	<br/>
	<!-- 
	<? if($this->viewParams['mode'] == "edit") :?>
	Current photo:	<img src="/public/archin/people/<?= $this->viewParams['id']?>/avatar.jpg" style="height:50px"/> </a>
	<?endif?>
	<br/>
	New photo:
	<input type="file" name="avatar" />
	<br/><br/>
	 -->
	Click to submit: <input type="submit" value="Submit" />
	<br/>
	<br/>
</form>

<script >
$(document).ready(function() {
	var arr = $('.rte').rte({
		css: ['default.css'],
		controls_rte: rte_toolbar,
		controls_html: html_toolbar,
		width: 400,
		height: 200,
		/*base_url: 'http://<?=Zend_Registry::get('configuration')->general->url?>/public/library/jquery/rte/',	*/
		base_url: 'http://<?=Zend_Registry::get('configuration')->general->url?>/public/library/jquery/rte/',
	});

	//$('.rte').css({'background-color' : '<?= $this->viewParams['bgcolor']?>'});
	$("a.color-switcher").click(function(){
		$('.rte').css({'background-color' : '<?= $this->viewParams['bgcolor']?>'});
	});
	//Remove the resizer, we don't need it in archin
	$(".rte-resizer").remove();
});
</script>
